import react from 'react';
export default class App extends react.Component{
    constructor(props){
        super(props)

    }
    // 卸载之前调用
    componentWillUnmount(){
        console.log('componentWillUnmount');
    }
    // 子组件的props 发生变化时调用
    componentWillReceiveProps(){
      console.log(  this.props.n );
    }
    render(){
        return <div>
            order 
<button onClick={()=>{ this.props.handler('hello','react') }}>子传父</button>
        </div>
    }
}